#include "includes.h"

OS_STK task1_stk[100];
OS_STK task2_stk[100];


void task1(void *date) reentrant;
void task2(void *date) reentrant;

void main(void)
{
  lcd_init()	;
	InitSerialBuffer();
	InitSerial();
	InitTimer0();
	OSInit();
	
	OSTaskCreate(task1, (void *)0, &task1_stk[0], 6);
	OSTaskCreate(task2, (void *)0, &task2_stk[0], 5);
	
	OSStart();
}
void task1(void *date) reentrant
{
	INT8U cnt;
  date=date;
	while(1)
	{
   if(cnt == 10)
	 {
     cnt = 0;
		 PrintStr("************************\n");
		 OSTaskDel(6);	
   }
	 cnt ++;
	 PrintStr("task1 is run \n");
	 
	 OSTimeDly(20);
		
  }
}
void task2(void *date) reentrant
{
  date=date;
	while(1)
	{
    PrintStr("task2 is run \n");
		OSTimeDly(20);
  }
}